package cn.zz.veggie.model.domain;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import lombok.Getter;
import lombok.Setter;

/**
 * 管理员表(Admin)实体类
 *
 * @author zhongq
 * @since 2024-05-13 20:46:03
 */
@Getter
@Setter

public class Admin {
    private Integer id;
    private String username;
    private String password;
    private String mobile;
    private String sale;
    private Long createAt;
    private Long updateAt;

    public boolean matchPassword(String password) {
        final String md5Passwd = SecureUtil.md5(password + sale);
        return StrUtil.equals(md5Passwd, this.password);
    }


}